import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../views/Login.vue' 
import LoginAdmin from '../views/LoginChildRouter/LoginAdmin.vue'
import LoginAdminJoint from '../components/LoginAdmin.vue'
import LoginDirector from '../views/LoginChildRouter/LoginDirector.vue'
import IndexA from '../views/IndexA.vue';
import IndexD from '../views/IndexD.vue';
import welcome from '../components/AdminWelcome.vue'
import userList from '../views/UserList.vue'
import RegisWorker from '../views/RegisWorker.vue'
import RegisDirector from '../views/RegisDirector.vue'
import RegisSpecialist from '../views/RegisSpecialist.vue'
import ReportManager from '../views/ReportManager.vue'
import Report from '../views/ReportManager.vue'
import ReportHistory from '../views/ReportHistory.vue'


const routes = [ 
  {
    path: '/',
    name: 'home',
    component: Login,
    children:[
      {
        path:'/',
        name:LoginAdminJoint,
        component:LoginAdminJoint
      },{
        path:'/LoginChildRouter/LoginAdmin',
        name:'LoginAdmin',
        component:LoginAdmin
      },{
        path:'/LoginChildRouter/LoginDirector',
        name:'LoginDirector',
        component:LoginDirector
      }
    ]

  },{
    path:'/IndexA',
    name:'IndexA',
    component:IndexA,
    children:[{
      path:'/IndexA',
      name:'adminHome',
      component:welcome 
    },{
      path:'/IndexA/userList',
      name:'userList',
      component:userList
    },{
      path:'/IndexA/RegisWorker',
      name:'RegisWorker',
      component:RegisWorker
    },{
      path:'/IndexA/RegisDirector',
      name:'RegisDirector',
      component:RegisDirector
    },{
      path:'/IndexA/RegisSpecialist',
      name:'RegisSpecialist',
      component:RegisSpecialist
    }]
  },{
    path:'/IndexD',
    name:'IndexD',
    component:IndexD,
    children:[{
      path:'/IndexD',
      name:'directorHome',
      component:Report
    },{
      path:'/IndexD/ReportManager',
      name:'ReportManager',
      component:ReportManager  
    },{
      path:'/IndexD/ReportHistory',
      name:'ReportHistory',
      component:ReportHistory
    }]
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
